<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>我的卡券</title>
    <link rel="stylesheet" href="__STATIC_URL__/static/mobile/css/weui.css" />
    <link rel="stylesheet" href="__STATIC_URL__/static/mobile/mycord/css/cord.css" />

</head>
<body>

<div class="container" id="container">




    <div class="harder"style="background:url(__STATIC_URL__/static/mobile/mycord/img/logo_2.png);background-size:100% 100%;">


        <!-- <div class="hfooter">
            <div class="hfr">发现新大陆</div>
            <div class="arrow"></div>
        </div>-->
    </div>

    <div class="body">
        <div class="nav bc_white">
            <div class="default" id="selected" data-id="selected">
                <a href="{:url('testuser/themachcard',['card_id'=>$card['card_id']])}">
                <img src="__STATIC_URL__/static/mobile/mycord/img/shang.png"class="icon"style="height:19px;padding-top:3px;"/>
                <div class="ictext">本商户优惠券</div>
                </a>
            </div>
            <div class=" default" id="selected1" data-id="selected1">
                <a href="{:url('testuser/mecard',['card_id'=>$card['card_id']])}">
                <img src="__STATIC_URL__/static/mobile/mycord/img/mycard.png"class="icon"/>
                <div class="ictext">我的优惠券</div>
                </a>
            </div>
            <div class=" default red" id="selected2" data-id="selected2">
                <img src="__STATIC_URL__/static/mobile/mycord/img/quan.png"class="icon"/>
                <div class="ictext">欠你的优惠券</div>

            </div>
        </div>
        <div class="content">



            <div class="selected1" style="display:block">
                <a href="javascript:;" class="clickself weui-media-box_appmsg" data-url="" data-id="" >
                    <div class='cardList'>

                        <div class='cardLi'>
                            <div class="semi_circle"></div>
                            <div class="semi_circle1"></div>
                            <div class="cardtop">
                                <div class="top_row already">全部门店</div>

                            </div>
                            <div class='cardleft'>
                                <img src='__STATIC_URL__/static/mobile/mycord/img/timg.jpg' mode='aspectFill' class='shopLogo'/>
                            </div>
                            <div class='cardRight flex'>
                                <div class='cardR-top'>
                                    <div class='cardR-top-left'>
                                        <div class='shopName'>光磊陶瓷形象店</div>
                                        <div class='cardName'>200元代金券</div>
                                        <div class='cardAddress'>全场满99可用</div>
                                    </div>
                                    <div class='cardR-top-right'>
                                        <img src="__STATIC_URL__/static/mobile/mycord/img/yi1.png" alt="" class="yi">
                                        <div class='cardAddress 'style="margin-top:43px;">最近距离100km</div>
                                    </div>
                                </div>
                                <div class='cardR-bottom'>
                                    <div class='cardR-bottom-left'>
                                        <div class='overdue'>截至日期：长期有效，</div>
                                        <div class='cardAddress orange'>剩余263天</div>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </a>
            </div>
            <div class="selected2" style="display:none">
                <div class="zanwu">
                    <img src="__STATIC_URL__/static/mobile/mycord/img/wu.png"class="wu"/>
                    <div>暂无优惠券，赶快来领取哦~~</div>
                </div>
            </div>
        </div>

    </div>
    <div class='cardWrap' id="Refresh">
        <img src="__STATIC_URL__/static/mobile/mycord/img/shuaxin.png"class="Refresh"/>
    </div>
</div>
</body>
<script src="__STATIC_URL__/static/jquery/3.2.1/jquery.min.js"></script>
<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>

    $("#Refresh").click(function(){
        window.location.reload();
    })
</script>
<script type="text/javascript">
    $(function () {
//        console.log(window.location.pathname/window.location.protocol/window.location.host);

        $(".clickself").click(function () {
            var id = $(this).attr("data-id");
            var url = $(this).attr("data-url");
            $.post({
                url: url,
                data: {
                    card_id: id,
                    url: window.location.href,
                },
                success: function (data) {
                    console.log(data);
                    wx.config({
                        debug: false,
                        appId: data.jssdk.appId,
                        timestamp: data.jssdk.timestamp,
                        nonceStr: data.jssdk.nonceStr,
                        signature: data.jssdk.signature,
                        jsApiList: [
                            'openCard',
                        ]
                    });
                    wx.ready(function () {
                        wx.openCard({
                            cardList: [
                                data.card
                            ]
                        });
                    });
                }
            })
        })
    });
</script>
</html>
